package com.iptv.grape.bu.imp;


import android.text.TextUtils;
import android.view.KeyEvent;

import com.iptv.grape.BaseActivity;
import com.iptv.grape.bu.AppState;
import com.iptv.grape.bu.GrapeContext;
import com.iptv.grape.bu.IKeyEventPorc;
import com.iptv.grape.domain.Channel;
import com.iptv.grape.util.AppLog;
import com.iptv.grape.util.ToastUtil;
import com.iptv.grape.video.XMediaPlayer;


// 输入数字按键换台操作
//0 = 7
//1 = 8
//2 = 9
//9 = 16
@AppState(isChangingLive = false,curPlayType="Live", curLiveType="ALL", keyVals = {7,8,9,10,11,12,13,14,15,16},isIgnoreTimeLiveUI=true)
public class StartChangingLive implements IKeyEventPorc {
    @Override
    public void onKeyDownEvent(BaseActivity context, XMediaPlayer mediaPlayer, GrapeContext grapeContext, KeyEvent event) {
        int num = event.getKeyCode() - 7;
        String keyNum = String.valueOf(num);
        grapeContext.setCurInputNum(keyNum);
        context.showChangingLiveUI();
        grapeContext.setChangingLive(true);

        context.setChangingLiveNo(grapeContext.getCurInputNum());
        grapeContext.startChangingLiveHandle();
    }
}
